//
// Created by 31897 on 2022/5/28.
//

#ifndef MAIN_CPP_DATA_STRUCTURE_H
#define MAIN_CPP_DATA_STRUCTURE_H

#endif //MAIN_CPP_DATA_STRUCTURE_H

//S
class str_S{
    std::string code;
    int begin, next;
public:
    int getBegin() const {
        return begin;
    }

    const std::string &getCode() const {
        return code;
    }

    void setCode(const std::string &code) {
        str_S::code = code;
    }

    int getNext() const {
        return next;
    }

    void setNext(int next) {
        str_S::next = next;
    }

    void setBegin(int begin) {
        str_S::begin = begin;
    }
};

//X
class str_X{
    std::string code;
    int begin,next;
    bool iselse;
public:
    const std::string &getCode() const {
        return code;
    }

    void setCode(const std::string &code) {
        str_X::code = code;
    }

    int getBegin() const {
        return begin;
    }

    void setBegin(int begin) {
        str_X::begin = begin;
    }

    int getNext() const {
        return next;
    }

    void setNext(int next) {
        str_X::next = next;
    }

    bool isIselse(){
        return iselse;
    }

    void setIselse(bool iselse) {
        str_X::iselse = iselse;
    }


};

//C
class str_C {
    std::string code;
    int isFalse,isTrue;
public:
    const std::string &getCode() const {
        return code;
    }

    void setCode(const std::string &code) {
        str_C::code = code;
    }

    int getIsFalse() const {
        return isFalse;
    }

    void setIsFalse(int isFalse) {
        str_C::isFalse = isFalse;
    }

    int getIsTrue() const {
        return isTrue;
    }

    void setIsTrue(int isTrue) {
        str_C::isTrue = isTrue;
    }


};

//E
class str_E {
    std::string code;
    std::string place;
public:
    const std::string &getCode() const {
        return code;
    }

    void setCode(const std::string &code) {
        str_E::code = code;
    }

    const std::string &getPlace() const {
        return place;
    }

    void setPlace(const std::string &place) {
        str_E::place = place;
    }
};

//T
class str_T{
    std::string code;
    std::string place;
public:
    const std::string &getCode() const {
        return code;
    }

    void setCode(const std::string &code) {
        str_T::code = code;
    }

    const std::string &getPlace() const {
        return place;
    }

    void setPlace(const std::string &place) {
        str_T::place = place;
    }


};

//F
class str_F {
    std::string code;
    std::string place;
public:
    const std::string &getCode() const {
        return code;
    }

    void setCode(const std::string &code) {
        str_F::code = code;
    }

    const std::string &getPlace() const {
        return place;
    }

    void setPlace(const std::string &place) {
        str_F::place = place;
    }
};

//Node
class Node{
    std::string type;
    std::string value;
public:
    const std::string &getType() const {
        return type;
    }

    void setType(const std::string &type) {
        Node::type = type;
    }

    const std::string &getValue() const {
        return value;
    }

    void setValue(const std::string &value) {
        Node::value = value;
    }
};

int scan(std::ifstream& in_file,std::ofstream& out_file);

bool MyFunction_S(std::ifstream& fp,str_S &tmpS);

bool MyFunction_X(std::ifstream& fp,str_X &tmpX);

bool MyFunction_E(std::ifstream& fp,str_E &tmpE);

bool MyFunction_C(std::ifstream& fp,str_C &tmpC);

bool MyFunction_T(std::ifstream& fp,str_T &tmpT);

bool MyFunction_F(std::ifstream& fp,str_F &tmpF);